Skip to content

Defer playlist reload while network is offline #7926

Open
robwalch wants to merge 1 commit into
masterfrom
bugfix/defer-offline-playlist-retry
Open

Defer playlist reload while network is offline #7926
robwalch wants to merge 1 commit into
masterfrom
bugfix/defer-offline-playlist-retry

Conversation

@robwalch

@robwalch robwalch commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

This PR will...

Defer offline media playlist load error retry until online status is restored.

Why is this Pull Request needed?

This makes Live and VOD offline behavior more consistent, since fragment loading retries are already deferred in the same way. Live was more likely to produce a fatal playlist load error than VOD because playlist retries were not deferred, and live playlists are reloaded at regular intervals.

Are there any points in the code the reviewer needs to double check?

Aligned with #7476

Applications are expected to escalate offline errors or stalls or timeouts while offline to fatal.

Resolves issues:

Resolves #7898

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

if (offlineStatus) {
this.log(`Waiting for connection (offline)`);
errorEvent.reason = 'offline';
this.timer = self.setTimeout(() => this.checkOfflineStatus(), 1000);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why timer?
we can probably track navigator.onLine via event Listener:
window.addEventListener("online", loadPlaylist)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some browsers that do not implement that event. The fragment implementation uses polling for that very reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Defer playlist reload while network is offline

2 participants